import request from '@/utils/request'

export default {
    getNoteTree(userId) {
        return request({
            url: '/note/tree',
            method: 'get',
            params: { userId }
        })
    },

    getNoteDetail(id) {
        return request({
            url: `/note/${id}`,
            method: 'get'
        })
    },

    addNote(data) {
        return request({
            url: '/note/add',
            method: 'post',
            data
        })
    },

    updateNote(id, data) {
        return request({
            url: '/note/update',
            method: 'post',
            data:{ id, ...data }
    })
    },

    deleteNote(id) {
        return request({
            url: `/note/delete/${id}`,
            method: 'get'
        })
    }
}